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

Query time 0.00061