UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kZeAvQfSLGpoZibHPaG2PZCFRlLCiYFL6OTBS18iLgo='
WHERE
key_id = '4efe2c7bea800141e8263dc78065856e6c29e2dd1442de318c4d507333a77d33'
AND (
token = 'kZeAvQfSLGpoZibHPaG2PZCFRlLCiYFL6OTBS18iLgo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)