UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ljVG10mrU8jUZUXmcf53jYHFTQhcATdWG7ACWg2e47w=' 
WHERE 
  key_id = '5310435536e3809fe5a0afe65ad4dc1a498782e380deab34b8af8ab44c5a5d1e' 
  AND (
    token = 'ljVG10mrU8jUZUXmcf53jYHFTQhcATdWG7ACWg2e47w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030