UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FNZayRHaMpc6HsM0T6V3L52MQ/iz2/6PS85Ikf/3atM=' 
WHERE 
  key_id = '1164c647d59d7569fc032eb7ba7234b0a06242f8a2b4dafbeb5428e9c33b97ab' 
  AND (
    token = 'FNZayRHaMpc6HsM0T6V3L52MQ/iz2/6PS85Ikf/3atM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028