UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MYfuCKjs8p6Wdmelsg5ob25oCCUZLRTGATZbAE5GPyk='
WHERE
key_id = '96f34db08744bdefd7917a9a2f7bb3497fa99680782076b8678cc0ecfc3da2d2'
AND (
token = 'MYfuCKjs8p6Wdmelsg5ob25oCCUZLRTGATZbAE5GPyk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)