UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'i1GHAQqPD6GVbB7F5OyBGER0iS07et171VJl0d2Qr+E='
WHERE
key_id = '205d77a81b1a0f99644817db697c2495e6cb07f96966a765bb1d52b5620e5db5'
AND (
token = 'i1GHAQqPD6GVbB7F5OyBGER0iS07et171VJl0d2Qr+E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)