UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '93ZfemwuPAOxfEt9Ipm9ij/KoSihLNrZ6w0yx+6ddUE='
WHERE
key_id = 'dd0b1891b532cb6091836ecc885d34a84efbcf341a2cada5146c1599dc42e0e1'
AND (
token = '93ZfemwuPAOxfEt9Ipm9ij/KoSihLNrZ6w0yx+6ddUE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)