UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ft5L7Kk+cvwYrQfxkmySnjXUATVps6OkeXDREdYhF44='
WHERE
key_id = '247b45fd91d6e40d0c6f1a28708361995c3b019c3dfb2656aa089982dfd044ec'
AND (
token = 'Ft5L7Kk+cvwYrQfxkmySnjXUATVps6OkeXDREdYhF44='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)