UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2mKzT2ctLzuKvGToR3iSuitx33B0fXFkaAjttgSFWqo=' 
WHERE 
  key_id = 'a90ada2a6ab70476f2aa527280c841a3f2da53260fe1ae0dc7dd2d481f4adf45' 
  AND (
    token = '2mKzT2ctLzuKvGToR3iSuitx33B0fXFkaAjttgSFWqo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027