UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wai/GtbZtUer96w177b+qn+F1RRcsTg0NqDsgItXu+o='
WHERE
key_id = '56249f48c94a57508770dcab7591d619df5d553492ee1ea69ad3d13d0fecaa22'
AND (
token = 'wai/GtbZtUer96w177b+qn+F1RRcsTg0NqDsgItXu+o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)