UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QoJ+BcHSuplXM8GbJfwaIxOBIvIdnNJfnWR7XgUa2t4=' 
WHERE 
  key_id = '7b3f816c9c6fb8a3735b7a0c16959ae3a4207ccbc39f4e30cabe82fa7f5bd006' 
  AND (
    token = 'QoJ+BcHSuplXM8GbJfwaIxOBIvIdnNJfnWR7XgUa2t4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031