UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'B5X8BK0Bz1CUfguM3zAfaQMY5Jru/W0j+O4mRtxLSXQ=' 
WHERE 
  key_id = 'aa672a25b0d32a9e4bb3bbb75298dc7457d3071442586836d390f77906a80c55' 
  AND (
    token = 'B5X8BK0Bz1CUfguM3zAfaQMY5Jru/W0j+O4mRtxLSXQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029