UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lv0C/OA41t7Bz4Revq6eicymJp86nXLv1H6GQZYlzO4=' 
WHERE 
  key_id = 'e13761a246118eba248de4cbb8ad7a6e2ab44394a15dd501a02796dc2debe432' 
  AND (
    token = 'lv0C/OA41t7Bz4Revq6eicymJp86nXLv1H6GQZYlzO4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032