UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'O1rF6UVqNnyCNO14NitxUKIjTrSV2EYFH/Lge9OUwsY='
WHERE
key_id = '539dc1d410306cce218f2b6eaa104373710165f6e75c071c49fb6458b855ae2e'
AND (
token = 'O1rF6UVqNnyCNO14NitxUKIjTrSV2EYFH/Lge9OUwsY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)