UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/8zj1/plE+8Dddgp2EaRYouziWLYkTnnwIo5V+WMpbQ='
WHERE
key_id = '216232e6491e45174a0c62e621eae31d846b7ec0a4aff4bb5ccbabae26aae776'
AND (
token = '/8zj1/plE+8Dddgp2EaRYouziWLYkTnnwIo5V+WMpbQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)