UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qdPQ51fpE115rnxWw9uCrtCQEy+dxcRIN8tLrbFIzIY=' 
WHERE 
  key_id = '308bb4d00197517bfe78328e6a5f79a4766f5c3d86c4f5f5879eb8e1f52e280a' 
  AND (
    token = 'qdPQ51fpE115rnxWw9uCrtCQEy+dxcRIN8tLrbFIzIY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017