UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'o3sRGPr8AUlmf3JaXAPyouoihY6sCe/1D/G05Q9QFlI='
WHERE
key_id = '264ee393be5e79da0a12ee0463366a3271689b3a55ba5f0a1f07fb8241e80bf9'
AND (
token = 'o3sRGPr8AUlmf3JaXAPyouoihY6sCe/1D/G05Q9QFlI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)