UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Msetn6G4qoTQBc7J13k4Dyo4Nm7TnPm2dZ/hgZYcf6k='
WHERE
key_id = '7a4d7936cbc2b12aabbfb0fe74ed52e21df45f1b153bbd76a71233d93ec1ddcf'
AND (
token = 'Msetn6G4qoTQBc7J13k4Dyo4Nm7TnPm2dZ/hgZYcf6k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)