UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TqqIuWLGPQagh5T812V0ARkJfPGYIWz/GqVoiYjbwTM=' 
WHERE 
  key_id = '3ac8ea8e96396c33e2a5a378d88bbf04132fed8239abd8c05dbf13f6a1d31e56' 
  AND (
    token = 'TqqIuWLGPQagh5T812V0ARkJfPGYIWz/GqVoiYjbwTM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031