UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4jIgnLDwnWX7G3ylgdx0fmOYpFNbw3vRHiNQ7TfDI8I=' 
WHERE 
  key_id = '5bb0472470c25a6e766ac5d3229ddec85331ea79cf01ef9734e8ea072d7a78ee' 
  AND (
    token = '4jIgnLDwnWX7G3ylgdx0fmOYpFNbw3vRHiNQ7TfDI8I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046