UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PdFHnhsF/z53DcUDcZvH5svVbJbH/tzj67dK4W5x74c='
WHERE
key_id = '7fde4f6e74f160af0e92df046f8e337e25c134d4eb00a152e056404d281c2ecd'
AND (
token = 'PdFHnhsF/z53DcUDcZvH5svVbJbH/tzj67dK4W5x74c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)