UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GfmUCxwBMTi3pIjxy0G07Nl0Ex1mrvPeg44cVUXzFRg=' 
WHERE 
  key_id = 'b0cb478b8f52ccaddf47b0c0b5cadec67d81a4871d69d8238a924b37c7bf5726' 
  AND (
    token = 'GfmUCxwBMTi3pIjxy0G07Nl0Ex1mrvPeg44cVUXzFRg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052