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

Query time 0.00027