UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'a8B+2xFakQMp0OGIkuBo6tfUVifKo10VbPDi5tCmuJQ=' 
WHERE 
  key_id = '2690c367dbd4041a99ec91b9d9f8542ac7df0ef10b55d836e3703068610dab69' 
  AND (
    token = 'a8B+2xFakQMp0OGIkuBo6tfUVifKo10VbPDi5tCmuJQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030