UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uswVV/zIkjS2JVwQipVcjbLkA4+95Qs5Io2tL1zEdWg='
WHERE
key_id = 'c5dc8d38e06ed4d0bf10025369bcdf4a6b2ee80696aab6bf2f3ae6cd7f58c656'
AND (
token = 'uswVV/zIkjS2JVwQipVcjbLkA4+95Qs5Io2tL1zEdWg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)