UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dtc/2dIf6rhpDG09nWsOHqoRzfhM5enLFKhlAUpqr44='
WHERE
key_id = '5a99998c536d0c5172a71271aad295273c5d132ff71d0b4bdfede5b6026e42f0'
AND (
token = 'dtc/2dIf6rhpDG09nWsOHqoRzfhM5enLFKhlAUpqr44='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)