UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aDbg8kEPiFUgVn2ke+iKvAksU4sRogeDc4TIr+o0rnc=' 
WHERE 
  key_id = 'ab3110535c1179549fa5c9ed4e91bf78f3bc79ccccf40aa721f5aaa0cc4e232f' 
  AND (
    token = 'aDbg8kEPiFUgVn2ke+iKvAksU4sRogeDc4TIr+o0rnc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028