UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ugtd9W1cDWYzb0fO0/6vYZ/bZf3g95w17HfWyFoydyU='
WHERE
key_id = 'cea1077785a29e032ef24d7147fb8c25f1032d66a041c0589299435f31c313b1'
AND (
token = 'ugtd9W1cDWYzb0fO0/6vYZ/bZf3g95w17HfWyFoydyU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)