UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/BG1cY8bdwaLmIaRGkKSPiNnDYhoa1Ym9VywRIE8FzQ='
WHERE
key_id = '048f12b0f56f7cf296f0c3770bf9d8a1b8d3810de4f8f5cfdd881d59ee257126'
AND (
token = '/BG1cY8bdwaLmIaRGkKSPiNnDYhoa1Ym9VywRIE8FzQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)