UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cVjV1KbbkBFsbJukIv2DD9PCNkb8qK4Y4/yjJQAuR3Y='
WHERE
key_id = 'df1a5b57d76e552f9a955fa286479ae9a8164cf73af70f0811ad31842b244bfa'
AND (
token = 'cVjV1KbbkBFsbJukIv2DD9PCNkb8qK4Y4/yjJQAuR3Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)