UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'D2gGj3003+IXPQPmL8oi+3h36cVBmtIGT2IxAVV9Q70='
WHERE
key_id = 'ce0f42df586adf10c081e2d1b2e7f772e00bd35c6f0b9f2909621928dd4e1d39'
AND (
token = 'D2gGj3003+IXPQPmL8oi+3h36cVBmtIGT2IxAVV9Q70='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)