UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+Hfz4ruHZ/bZQCvLganQfEyJOvUhCgaQCnbRdx3Pxz8='
WHERE
key_id = '2415dc1b282f4fa4c7a310146e129882832557868d26b40bbaa59a78bd748fa9'
AND (
token = '+Hfz4ruHZ/bZQCvLganQfEyJOvUhCgaQCnbRdx3Pxz8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)