UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4i9WzvIlYyLcBW27G1S+TEOZg1J1S26sgyv6VWQMlcQ=' 
WHERE 
  key_id = 'f3aa347227e89f4f8cf077b6d510490cb54101f88fe34988e188cbfe1c3696c1' 
  AND (
    token = '4i9WzvIlYyLcBW27G1S+TEOZg1J1S26sgyv6VWQMlcQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027