UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kjdANwwNCZ+VQGU7Y+FLkfuO5LT8FzLKVOn0zIrZpdw=' 
WHERE 
  key_id = '033f9594cb404972db7a34ce92f0798c456bc9c04caf129738f27cd6a09b86a3' 
  AND (
    token = 'kjdANwwNCZ+VQGU7Y+FLkfuO5LT8FzLKVOn0zIrZpdw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031