UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cxPRuJab8Y5CrnDOHGn4y7zpphudZL8rcqJJiCNz6Yc=' 
WHERE 
  key_id = '6a98afce54dc71fb0624e77e682b29ec90e67cd9ed18d01ef11cf333d1fb16dc' 
  AND (
    token = 'cxPRuJab8Y5CrnDOHGn4y7zpphudZL8rcqJJiCNz6Yc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051