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