UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eMFUsSm5Va6SKc58uXjU2GR80wl0GVv5WZBwuG2Wodw=' 
WHERE 
  key_id = '521e7013dd2e9fd44cf27035c1da754372b83643455f98bf2268e7bcea208ada' 
  AND (
    token = 'eMFUsSm5Va6SKc58uXjU2GR80wl0GVv5WZBwuG2Wodw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045