UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MJspBezkX0xbDPNn5XXVf9tnRmem3FvSs0TU1NHbqLo='
WHERE
key_id = 'd6df105ba7df6a537436b3b85fe05c09544e3b5361906b259b00ae3cd2ef5882'
AND (
token = 'MJspBezkX0xbDPNn5XXVf9tnRmem3FvSs0TU1NHbqLo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)