UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JIh+p7RNfA/7mAMVglKGvMgnN3kvoNLT0Y1cdE+HNZ8=' 
WHERE 
  key_id = '724897a4497e24d030503edcae8fcf3300cf88b0d3cd72c0000ad2bf933b318e' 
  AND (
    token = 'JIh+p7RNfA/7mAMVglKGvMgnN3kvoNLT0Y1cdE+HNZ8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029