UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TGynC5kEQGM3AwfpLwxDbS4l+DTK83NRrqD/lOaVYlg=' 
WHERE 
  key_id = 'be0169250a0113fb3c71fe475f5ef2a71f23bc9c18995afccb5a76d293990cd0' 
  AND (
    token = 'TGynC5kEQGM3AwfpLwxDbS4l+DTK83NRrqD/lOaVYlg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030