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

Query time 0.00030